package com.fengmoxi.ctv.activity.config.lamp.other;

import android.os.Bundle;

import androidx.annotation.NonNull;
import androidx.leanback.app.GuidedStepSupportFragment;
import androidx.leanback.widget.GuidanceStylist;
import androidx.leanback.widget.GuidedAction;

import com.fengmoxi.ctv.R;
import com.fengmoxi.ctv.manage.LampManage;

import java.util.List;

public class ConfigLampInitParamFragment extends GuidedStepSupportFragment {

    @NonNull
    @Override
    public GuidanceStylist.Guidance onCreateGuidance(Bundle savedInstanceState) {
        return new GuidanceStylist.Guidance(getString(R.string.conf_lamp_info_init_title),
                getString(R.string.conf_lamp_info_init_desc), "", null);
    }

    @Override
    public void onCreateActions(@NonNull List<GuidedAction> actions, Bundle savedInstanceState) {
        actions.add(new GuidedAction.Builder(getContext()).clickAction(GuidedAction.ACTION_ID_CANCEL).build());
        actions.add(new GuidedAction.Builder(getContext()).clickAction(GuidedAction.ACTION_ID_OK).build());
    }

    @Override
    public void onGuidedActionClicked(GuidedAction action) {
        if (action.getId() == GuidedAction.ACTION_ID_OK) {
            new LampManage().initUserParam();
        }
        requireActivity().finish();
    }
}
